<template>
<div>
  <ul class="list">
    <li v-for="(item,index) in list" :key="index">
      <router-link :to="{path:'musicPlay',query:{songid:item.song_id}}"><img :src="item.pic_big" alt=""><p>{{item.title}}</p></router-link></li>
  </ul>
</div>
</template>

<script>
// import axios from 'axios'
import {getSongList} from "@/api/api";

export default {
name: "todayList",
  data(){
  return{
    list:[],

  }
  },
  props:['size','type'],
created() {
//   axios.get(`/api/v1/restserver/ting/baidu.ting.billboard.billList?method=baidu.ting.billboard.billList&type=${this.type}&size=${this.size}&offset=0`).then(res=>{
//     this.list = res.data.song_list
//   })
getSongList(this.type,this.size,this.method).then(res=>{
  console.log(res)
  this.list = res.song_list
})
}
}
</script>

<style scoped lang="less">

.list{
  list-style: none;
  overflow: hidden;
  border-bottom: 10px solid #f5f5f5;
  li{
    width: calc(100%/3);
    float: left;
    padding: 5px;
    text-align: center;
    box-sizing: border-box;
    font-size: 12px;
    color: #999;
    img{
      width: 80%;
    }
  }

}
</style>